<script>
function is_check(){
	$('input[type=checkbox][name=mc_id_arr[]]:checked').each(function(){
		return true;
	});
	alert('没有勾选设备');
	return false;
}

$("document").ready(function(){
     
   $("#all").click(function(){   
    if(this.checked){   
        $("input[name='mc_id_arr[]']").each(function(){this.checked=true;});
       // $("#btn1").attr("value","反选");   
    }else{   
        $("input[name='mc_id_arr[]']").each(function(){this.checked=false;});   
       // $("#btn1").attr("value","全选"); 
    }   
 }); 
});
</script>
<h2 class="title">{%if $act eq 'add'%}添加{%else%}修改{%/if%}计划批复</h2>
<form action="index.php?c=zy_plan_reply&m={%$act%}&post=1" method=post name=frm enctype="multipart/form-data" onSubmit="return Validator.Validate(this,3)">
<table class="tb_term" width="100%">
<tr>
	<td class="tr_td_width01 alignright">计划申请编号</td>
	<td>
	{%if $investment_no%}		
		<input type="text" class="input_edit_stand txt-normal" name='investment_no' id='investment_no' value='{%$investment_no%}'   />&nbsp;&nbsp;
		<a href="index.php?c=zy_nvestment&is_jump=1" >请重新选择</a>
	{%else%}
		<input type="text" class="input_edit_stand txt-normal" name='investment_no' id='investment_no' value=''  readonly />&nbsp;&nbsp;
		<a href="index.php?c=zy_nvestment&is_jump=1" >请选择</a>
	{%/if%}	
	</td>
	<td class="tr_td_width01 alignright">计划申请日期</td>
	<td class="tr_td_width04">
		<input type=text  class="input_date_edit txt-normal"  name="plan_reply_time" value='{%if $plan_reply_time %}{%$plan_reply_time|date_format:"%Y-%m-%d"%}{%/if%}' id="plan_reply_time" readonly />
		<script>
			Calendar.setup({
				inputField     :    "plan_reply_time",   // id of the input field
				ifFormat       :    "%Y-%m-%d",       // format of the input field
				showsTime      :    false,
				timeFormat     :    "24"
			});
		</script>
	</td>
</tr>
<tr>
	<td class="alignright">计划批复编号</td>
	<td><input type=text  class="input_edit_stand txt-normal" name="plan_reply_no" value='{%$plan_reply_no%}' dataType="Require" msg=""></td>
	<td class="alignright">计划批复日期</td>
	<td>
		<input type=text  class="input_date_edit txt-normal" name="plan_reply" id="plan_reply"  value='{%if $plan_reply%}{%$plan_reply|date_format:"%Y-%m-%d"%}{%else%}{%$smarty.get.plan_reply%}{%/if%}' readonly>
		<script>
			Calendar.setup({
				inputField     :    "plan_reply",   // id of the input field
				ifFormat       :    "%Y-%m-%d",       // format of the input field
				showsTime      :    false,
				timeFormat     :    "24"
			});
		</script>
	</td>
</tr>
<tr>	
	<td class="alignright">计划批复金额</td>
	<td><input type=text  class="input_edit_num txt-normal" name="plan_reply_price" value='{%if $act == 'add'%}{%$cost%}{%else%}{%$plan_reply_price%}{%/if%}' dataType="Currency" msg=""><label class="label01">万元</label></td>
	<td class="alignright">计划调整编号</td>
	<td><input type=text   name="plan_change_no" value='{%$plan_change_no%}' msg=""></td>
</tr>
<tr>	
	<td class="alignright">计划调整金额</td>
	<td ><input type=text  class="input_edit_num txt-normal" name="plan_change_price" value='{%$plan_change_price%}'><label class="label01">万元</label></td>
	<td class="alignright">计划调整日期</td>
	<td>
		<input type=text  class="input_date_edit txt-normal" name="plan_change_time" id="plan_change_time"  value='{%$plan_change_time|date_format:"%Y-%m-%d"%}' readonly>
		<script>
			Calendar.setup({
				inputField     :    "plan_change_time",   // id of the input field
				ifFormat       :    "%Y-%m-%d",       // format of the input field
				showsTime      :    false,
				timeFormat     :    "24"
			});
		</script>
	</td>
</tr>
<tr>
	<td class="alignright">计划批复备注</td>
	<td colspan="3"><textarea class="textarea_edit txt-normal" rows="3" id="plan_reply_content" name="plan_reply_content">{%$plan_reply_content%}</textarea></td>
</tr>

{%if $v_mc_arr%}
<tr>
	<td colspan="4">
		<table class="tb_list" width="98%">
		<tr>
			<td class="list_checkbox"><input class="" type="checkbox" id="all" /></td>
			<td class="list_td_zw_04">批复序号</td>
			<td class="list_td_zw_10">设备名称</td>
			<td class="list_td_zw_03">数量</td>
			<td class="list_td_zw_03">单位</td>
			<td class="list_input">批复数量</td>
			<td class="list_input">批复金额(万元)</td>
			<td class="list_input">调整金额(万元)</td>
			<td>所属项目</td>
		</tr>
		{%foreach item=v_mc key=key from=$v_mc_arr%}
		<tr>
			<td><input type="checkbox" name="mc_id_arr[]" value ="{%$v_mc.v_mc_id%}" {% if $act == 'edit' && $v_mc.is_reply %}checked{%/if%} {%if $key==$coun%}dataType="Group" min="1"  msg=""{%/if%}></td>
			<td class="alignleft"><input  type="text" class="input_num_03 txt-normal" name="zy_plan_replay_no_{%$v_mc.v_mc_id%}" {%if $v_mc.zy_plan_replay_no %} value="{%$v_mc.zy_plan_replay_no%}" readonly {%else%}{%/if%}></td>
			<td class="alignleft" title="{%$v_mc.mc_cn_name%}"> {%$v_mc.mc_cn_name%}</td>
			<td>{%if $v_mc.plan_reply_mc_number %}{%$v_mc.plan_reply_mc_number%}{%else%}{%$v_mc.last_no%}{%/if%}</td>
			<td>{%$v_mc.unit%}</td>
			<td class="alignleft"><input  type="text" class="input_num_small txt-normal" name="reply_num_{%$v_mc.v_mc_id%}" size="12"  {%if $v_mc.plan_reply_mc_number %} value="{%$v_mc.plan_reply_mc_number%}" readonly {%else%}value="{%$v_mc.last_no%}"{%/if%}></td>
			<td class="alignleft"><input type="text" class="input_num_small txt-normal" name="reply_price_{%$v_mc.v_mc_id%}" size="15 "value="{%if $act == 'add'%}{%$v_mc.make_cost%}{%else%}{%if $v_mc.plan_reply_mc_all_cost%}{%$v_mc.plan_reply_mc_all_cost|string_format:'%.2f'%}{%else%}{%$v_mc.make_cost%}{%/if%}{%/if%}"></td>
			<td class="alignleft"><input type="text" class="input_num_small txt-normal" name="change_price_{%$v_mc.v_mc_id%}" size="15 "value="{%if $act == 'add'%}{%$v_mc.change_price%}{%else%}{%if $v_mc.change_price%}{%$v_mc.change_price|string_format:'%.2f'%}{%else%}{%$v_mc.make_cost%}{%/if%}{%/if%}"></td>
			<td class="alignleft" title="{%$project_arr[$v_mc.project_id]%}">{%$project_arr[$v_mc.project_id]%}</td>
		</tr>
		{%/foreach%}
		</table>
	</td>	
</tr>
{%/if%}

</table>
<p class="btn_right">
	<input type=hidden name='plan_reply_id' id='plan_reply_id' value='{%$plan_reply_id%}'>
	<button type="submit" class="b-default" hidefocus="true"><span><em>{%if $act eq 'add'%}提交{%else%}更新{%/if%}</em></span></button>
	<button type="button" class="b-default" hidefocus="true" onclick="javascript:location.href='index.php?c=zy_plan_reply'"><span><em>返回</em></span></button>
</p>
</form>